// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './vuex/store'

// 初始化
import './assets/css/reset.css'
import './assets/css/common.css'
import './assets/css/plugs.css'
import './assets/css/aniamte.css'

// 全局方法
import _g from './assets/js/globalFunctions'
window._g = _g
window.$store = store

import "./assets/js/onresize"

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})

router.beforeEach((to, from, next) => {
  
  if(!new Array(router.options.routes.length).fill("").map((val,index)=>router.options.routes[index].path).includes(to.path)){
    router.push("/error/404")
  }
  next()
})

router.afterEach((to,from)=>{

})
